package dto

import (
	"vrcm/src/vrcm/app/admin/models/monitor"
	"vrcm/src/vrcm/common/dto"
	common "vrcm/src/vrcm/common/models"
)

type WorksiteGetPageReq struct {
	dto.Pagination `search:"-"`
	TenantId       string `json:"tenant_id"  search:"type:exact;column:tenant_id;table:worksite"`
	EventId        int    `json:"event_id"  search:"-"`
}

type WorksiteInsertReq struct {
	Id                int    `json:"-" comment:""` //
	TenantId          string `json:"tenant_id" comment:"租户"`
	Worksite          string `json:"worksite" comment:"工口名"`
	WorksiteType      int    `json:"worksite_type" comment:"类型 1系统 2自定义"`
	WorksiteAuthority string `json:"worksite_authority" comment:"工口权限"`
	common.ControlBy
}

type WorksiteGetReq struct {
	Id int `json:"id"`
}

type WorksiteUpdateReq struct {
	Id                int    `json:"id" comment:""` //
	TenantId          string `json:"tenant_id" comment:"租户"`
	Worksite          string `json:"worksite" comment:"工口名"`
	WorksiteType      int    `json:"worksite_type" comment:"类型 1系统 2自定义"`
	WorksiteAuthority string `json:"worksite_authority" comment:"工口权限 1流程控制 2监控启停 3发送公告 4时长监看 5返送监看 6电子流程 7公告消息 8审片管理 9返监端水印显示"`
	common.ControlBy
}

type WorksiteDeleteReq struct {
	Id int `json:"id"`
}

type MemberGetPageReq struct {
	dto.Pagination `search:"-"`
	TenantId       string `json:"tenant_id"  search:"type:exact;column:tenant_id;table:worksite_member"`
}

type MemberInsertReq struct {
	Id            int    `json:"-" comment:""` //
	TenantId      string `json:"tenant_id" comment:"租户"`
	MemberName    string `json:"member_name" comment:"成员名"`
	MemberAccount string `json:"member_account" comment:"成员账号"`
	MobilePhone   string `json:"mobile_phone" comment:"手机号"`
	WorkSiteId    int    `json:"worksite_id" comment:"工口id"`
	common.ControlBy
}

type MemberGetReq struct {
	Id int `json:"id"`
}

type MemberGetByAuthorityReq struct {
	TenantId  string `json:"tenant_id" comment:"租户"`
	Authority int    `json:"authority" comment:"权限"`
}

type WorksiteMemberGetReq struct {
	TenantId string `json:"tenant_id" comment:"租户"`
}

type MemberUpdateReq struct {
	Id            int    `json:"id" comment:""` //
	TenantId      string `json:"tenant_id" comment:"租户"`
	MemberName    string `json:"member_name" comment:"成员名"`
	MemberAccount string `json:"member_account" comment:"成员账号"`
	MobilePhone   string `json:"mobile_phone" comment:"手机号"`
	WorkSiteId    int    `json:"worksite_id" comment:"工口id"`
	common.ControlBy
}

type MemberDeleteReq struct {
	Id int `json:"id"`
}

type WorksiteNoticeInsertReq struct {
	EventId         int              `json:"event_id" comment:"事件id"`
	TenantId        string           `json:"tenant_id" comment:"租户"`
	ProgramId       string           `json:"program_id" comment:"节目单id"`
	WorksiteNotices []WorksiteNotice `json:"worksite_notices" comment:""`
	DelIds          []int            `json:"del_ids" comment:""`
}

type WorksiteNoticeUpdateReq struct {
	Id          int    `json:"id" comment:""` //
	WorksiteIds string `json:"worksites" comment:"工口id"`
	Notice      string `json:"notice" comment:"通知"`
	Duration    int    `json:"duration" comment:"时长"`
}

type ExportWorksiteNoticeReq struct {
	EventId                int                     `json:"event_id" comment:"事件id"`
	TenantId               string                  `json:"tenant_id" comment:"租户"`
	ProgramWorksiteNotices []ProgramWorksiteNotice `json:"program_worksite_notices" comment:"租户"`
	TaiBen                 []TaiBenInsertReq       `json:"tai_ben" comment:"租户"`
	ProgramId              string                  `json:"program_id" comment:"节目单id"`
}
type ProgramWorksiteNotice struct {
	ProgramId       string           `json:"program_id" comment:"节目单id"`
	WorksiteNotices []WorksiteNotice `json:"worksite_notices" comment:""`
}

type SetWorksiteNoticeDurationReq struct {
	Id       int    `json:"id" comment:""`
	TenantId string `json:"tenant_id" comment:"租户"`
	Duration int    `json:"duration" comment:"持续时间"`
}

type WorksiteNotice struct {
	Id              int    `json:"id" comment:""` //
	TenantId        string `json:"tenant_id" comment:"租户"`
	EventId         int    `json:"event_id" comment:"事件id"`
	WorksiteIds     string `json:"worksites" comment:"工口id"`
	Notice          string `json:"notice" comment:"通知"`
	ProgramId       string `json:"program_id" comment:"节目单id"`
	NoticeState     int    `json:"notice_state" gorm:"tinyint;comment:消息状态 1发送 2未发送"`
	StateUpdateTime int    `json:"state_update_time" gorm:"int;comment:状态更新时间"`
	common.ControlBy
}

type WorksiteNoticeDeleteReq struct {
	EventId   int    `json:"event_id" comment:"事件id"`
	ProgramId string `json:"program_id" comment:"节目单id"`
}

type WorksiteNoticeGetReq struct {
	EventId   int    `json:"event_id" comment:"事件id"`
	ProgramId string `json:"program_id" comment:"节目单id"`
	//UpdateState int    `json:"update_state" comment:"是否发布"`
}

type WorksiteNoticeSendReq struct {
	Id         int    `json:"id" comment:"通知记录id"`
	Duration   int    `json:"duration" comment:"持续时间"`
	TenantId   string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	EventId    int    `json:"event_id" gorm:"type:bigint;comment:活动id"`
	WorkSiteId string `json:"worksite_id"  gorm:"column:worksite_id;type:varchar(100);comment:工口id"`
	Notice     string `json:"notice" gorm:"varchar(2000);comment:消息"`
	ProgramId  string `json:"program_id" gorm:"varchar(50);comment:节目单id"`
	IsSend     int    `json:"is_send"  gorm:"tinyint;comment:是否发送 1是 2否 "`
}

type SetWorksiteAuthorityReq struct {
	WorksiteAuthority []WorksiteAuthority `json:"worksite_authority" comment:"权限"`
}

type WorksiteAuthority struct {
	Id int `json:"id" comment:""`
	//TenantId  string `json:"tenant_id" comment:"租户"`
	Authority int `json:"authority" comment:"权限"`
	SetType   int `json:"set_type" comment:"设置类型 1新增 2删除"`
}

type TaiBenInsertReq struct {
	EventId   int              `json:"event_id" comment:"事件id"`
	TenantId  string           `json:"tenant_id" comment:"租户"`
	ProgramId string           `json:"program_id" comment:"节目单id"`
	TaiBen    []monitor.TaiBen `json:"tai_ben" comment:""`
	DelIds    []int            `json:"del_ids" comment:""`
}

type TaiBenGetReq struct {
	EventId   int    `json:"event_id" comment:"事件id"`
	ProgramId string `json:"program_id" comment:"节目单id"`
}

type TaiBenDeleteReq struct {
	Ids []int `json:"ids" comment:""`
}

type NoticeConfirm struct {
	NoticeId   int `json:"notice_id" comment:"消息id"`
	WorksiteId int `json:"worksite_id" comment:"消息id"`
}
